class code3 {
    //搜索插入位置
    public int searchInsert(int[] nums, int target) {
        //左边界
        int left = 0,right = nums.length;
        while(left<right) {
            int mid = left+(right-left)/2;
            if(nums[mid]<target) left = mid+1;
            else right = mid;
        }
        return left;
    }
}